import React, { PureComponent } from 'react';
import { Popover, Icon } from 'antd';

export default class TaobaoApproveColumn extends PureComponent {
  render() {
    const { value } = this.props;
    if (value.auditStatusName) {
      let color = '';
      if (value.auditStatusName === '审核中') {
        color = 'rgb(252, 166, 28)';
      } else if (value.auditStatusName === '审核通过') {
        color = 'rgb(74, 190, 90)';
      } else if (value.auditStatusName === '审核不通过') {
        color = 'rgb(248, 109, 109)';
      }
      return (
        <div>
          <div><span style={{ color, marginRight: 5 }}>淘宝{value.auditStatusString}</span>
          {value.auditStatusName === '审核不通过' ?
            <Popover placement="top" content={value.reason} trigger="hover">
              <Icon type="question-circle-o" />
            </Popover>: ''}
          </div>
        </div>
      );
    } else {
      return '';
    }
  }
}